package com.yijiu.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.yijiu.trb.R;

public class FilterAdapter extends BaseAdapter {

	private Context context;

	private String[] str;

	public FilterAdapter(Context context, String[] str) {
		this.context = context;
		this.str = str;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return str.length;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return str[position];
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		convertView = LayoutInflater.from(context).inflate(R.layout.view_filter_name, null);
		TextView textView = (TextView) convertView.findViewById(R.id.tv_filter_adapter_name);
		String s = str[position];
		textView.setText(s);
		return convertView;
	}

}
